import React, { useState } from 'react';
import './App.less';
import {ConfigProvider} from 'antd';
import zhCN from 'antd/es/locale/zh_CN';
import enUS from 'antd/es/locale/en_US';
import 'moment/locale/zh-cn';
import {Provider} from 'react-redux';
import store from './component/store/index';
import 'lib-flexible';


import AppRouter from './component/AppRouter';


const App = () => {
  const [localLang, setLocalLang] = useState(zhCN)
  //暂时用下，后面用localstore
  // eslint-disable-next-line
  const setLang = () => {
    let lang = localLang === zhCN ? enUS : zhCN;
    setLocalLang(lang)
  }

  return (
      <>
        <ConfigProvider
          locale={localLang}
        >
          {/* <div style={{padding: 5,border: '1px solid #000', width: 100,textAlign: 'center'}} onClick={() => setLang()}>AppRouter切换语言</div> */}
          <Provider store={store}>
            <AppRouter />
          </Provider>
        </ConfigProvider>
      </>
  );
}

export default App;
